<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <script src="../js/vue.min.js"></script>
</head>
<body>
<div id="app">
    <ul >
        <li v-for="(item,index) in items">
            {{ parentMessage }} - {{ index }} - {{ item.message }}
        </li>
    </ul>
    <button @click="godata">提交</button>
    </div>
    <script>
        var example2 = new Vue({
            el: '#app',
            data: {
                parentMessage: '菜鸟教程官网',
                items: [
                    { message: 'www.runoob.com' },
                    { message: 'www.w3cschool.cc' }
                ]
            },
            methods:{
                godata:function(){
                    var sendData={
                        token:"a123",
                        workOrderNo: "ddd",
                        planCarNo:"bbb",
                        cusName: "ccc",
                        distributorName: "eee",
                        distributorId: "fff",
                        techUserName: "ggg",
                        settlementDateStart:"hha1"

                    }
                    console.log(sendData);
                    var form_excel=document.createElement("form");
                    document.body.appendChild(form_excel);
                    form_excel.action="http://www.sina.com";
                    form_excel.method="post";
                    form_excel.target="_blank"
                    form_excel.setAttribute("accept-charset", "utf-8");
                    var i=0
                    var table_inn=[]
                    for (var key in sendData)
                    {
//                    alert(key); alert(json[key]);
                        if(sendData[key]!=""){
                            table_inn[i]= document.createElement("input")
                            table_inn[i].name=key
                            table_inn[i].type="hidden"
                            table_inn[i].value=sendData[key]
                            form_excel.appendChild(table_inn[i])
                        }
                    }

//                    form_excel.setRequestHeader("token","952144");

                    form_excel.submit();
                }

            }
        })
    </script>
</body>
</html>
